/*
 *  Arrow
 *
 *  Created by David Giovannini on 1/5/07.
 *  Copyright 2007 Software by Jove. All rights reserved.
 *
 */
 
#ifndef SBJ_Arrow_IPublisher_h
#define SBJ_Arrow_IPublisher_h
 
#include "SBJ/Arrow/IRouter.h"

#include <boost/shared_ptr.hpp>

namespace SBJ
{

namespace Arrow
{

class Subscription;

class IPublisher
{
public:
	typedef boost::shared_ptr< IPublisher > Ptr;
	
	/// Override to start producing messages
	virtual bool start( void ) = 0;
	
	/// Override to stop producing messages
	virtual bool stop( bool join = true ) = 0;
	
	/// Override to add a router that will receive produced messages
	virtual bool addRouter( const IRouter::Ptr& router ) = 0;
	
	/// Override to remove a router
	virtual bool removeRouter( const IRouter::Ptr& router ) = 0;
	
	/// Override to be informed of subscription activity
	virtual void addInterest( const Subscription& subscription ) {}
	
	/// Override to be informed of subscription activity
	virtual void removeInterest( const Subscription& subscription ) {}
};

}

}

#endif